package com.lds.config.center.server.business.cluster.converter;

import com.lds.config.center.common.model.cluster.request.ClusterBaseListPageRequest;
import com.lds.config.center.server.business.cluster.entity.Cluster;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class ClusterBaseListPageRequestToEntityConverter implements Converter<ClusterBaseListPageRequest, Cluster> {

    @Override
    public Cluster convert(ClusterBaseListPageRequest source) {
        return Cluster.builder()
                .id(source.getId())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .name(source.getName())
                .envId(source.getEnvId())
                .desc(source.getDesc())
                .build();
    }

}


